package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * Created by ChenYong on 2017-07-12.
 * <br>
 * 父资源 <code>List</code> 的请求参数。
 */
public class ResourceChildListParam extends IdParam {
    /**
     * 父资源 ID
     */
    @NotNull(message = "父资源ID不能为空")
    @Range(min = Constants.VALUE_L_0, max = Long.MAX_VALUE, message = "父资源ID在0至9223372036854775807之间")
    protected Long parentId;
    /**
     * 资源类型
     */
    @NotNull(message = "资源类型不能为空")
    @Range(min = Constants.VALUE_1, max = Constants.VALUE_999, message = "资源类型在1至999之间")
    private Integer resourceType;

    /**
     * 默认构造器。
     */
    public ResourceChildListParam() {
        super();
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getResourceType() {
        return resourceType;
    }

    public void setResourceType(Integer resourceType) {
        this.resourceType = resourceType;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("ResourceChildListParam{");
        sb.append("parentId=").append(parentId);
        sb.append(", resourceType=").append(resourceType);
        sb.append(", id=").append(id);
        sb.append('}');
        return sb.toString();
    }
}